<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath+"admin" + "/"%>">    
    <title>添加内容</title>
    <link rel="stylesheet" type="text/css" href="skin/css/base.css">
    <script type="text/javascript">   	
    	function doSubmit()
    	{
    		if(document.adFM.title.value == "")
    		{
    			alert("请输入标题!");
    			return;
    		}
    		
    		if(document.adFM.href.value == "")
    		{
    			alert("请输入链接地址!");
    			return;
    		}
    		
    		if(document.adFM.type.value == 255)
    		{
    			alert("请选择类型!");
    			return;
    		}
    		
    		if(document.adFM.status.value == 255)
    		{
    			alert("请选择状态!");
    			return;
    		}    		
    		document.adFM.submit();
    	}
    </script>
  </head>  
  <body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>
		<!--  内容列表   -->
		<form name="adFM" action="<%=path%>/admin/AdMgr.do" method="post">
			<input type="hidden" name="action_method" value="insert">			
			<table width="98%" border="0" cellpadding="2" cellspacing="1"
				bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="2" background="skin/images/tbg.gif">
						&nbsp;添加内容&nbsp;
					</td>
				</tr>				
				<tr height="22">
					<td width="8%" bgcolor="#FAFAF1" align="right">
						标题
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<input type="text" name="title" size="88" value="">
					</td>
				</tr>				
				<tr height="22">
					<td width="8%" bgcolor="#FAFAF1" align="right">
						链接地址(href)
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<input type="text" name="href" size="88" value="">						
					</td>					
				</tr>
				<tr height="22">
					<td width="8%" bgcolor="#FAFAF1" align="right">
						图片(src)
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<input type="text" name="source" size="88" value="">						
					</td>					
				</tr>
				<tr height="22">
					<td width="8%" bgcolor="#FAFAF1" align="right">
						类型
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<select name="type" onchange="changeState()">
							<option value="255">-- 请选择 --</option>
							<option value="0" >文字广告</option>
							<option value="1" >图片广告</option>
						</select>
					</td>
				</tr>	
				<tr height="22">
					<td width="8%" bgcolor="#FAFAF1" align="right">
						状态
					</td>
					<td width="96%" bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<select name="status" onchange="changeState()">
							<option value="255">-- 请选择 --</option>
							<option value="0" >上线</option>
							<option value="1" >下线</option>
						</select>
					</td>
				</tr>								
				
				<tr bgcolor="#FAFAF1">
					<td height="35" colspan="10">
						&nbsp;
						<input class="coolbg" type="button" value="保存" onclick="doSubmit()"/>					
					</td>
				</tr>			
			</table>
		</form>		
	</body>
</html>